'use strict';

var Ware = require('../model/ware.js');
var redisCo = require('../model/redisCo.js');


function* save(ware) {
	var result = yield ware.save();
	return result;
}

function* findById(id) {
	var result = yield Ware.findOne({
			_id: id
		})
		.populate('category')
		.exec();
	return result;
}


module.exports.save = save;
module.exports.findById = findById;